//Written and Directed by Isaac Rudich and David Nicholson
package tabulatorCtrl;

import java.awt.TextArea;
import java.awt.Toolkit;

import javax.swing.JFrame;
import javax.swing.JScrollPane;
import javax.swing.ScrollPaneConstants;
import javax.swing.WindowConstants;

import electionView.NonUserInputElectionGui;

public class TabulatorGUI extends NonUserInputElectionGui{
	
	private TextArea resultTextArea;
	private JScrollPane scrollPane;
	
	public TabulatorGUI(String votes){
		super(null, new JFrame("Results"));
		this.mainFrame.setSize(Toolkit.getDefaultToolkit().getScreenSize());
		this.mainFrame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
				
		this.resultTextArea = new TextArea(votes, 40, 115);
		this.scrollPane = new JScrollPane(this.resultTextArea);
		this.scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
		this.scrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
		this.resultTextArea.setEditable(false);
		
		this.mainFrame.add(this.resultTextArea);
	}
}
